﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;

namespace Lab7_MutilLanguage
{
    public partial class Executive : System.Web.UI.Page
    {
        protected DataTable dt = new DataTable();
        protected void Page_Load(object sender, EventArgs e)
        {
            DataProvider data = new DataProvider();
            string str = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
            data.MyConnectionString = str;
            //data.MyConnectionString = @"Data source=.;Integrated Security=SSPI;Initial Catalog=PagingData";
            //data.MyConnectionString = "Data source=" + Server.MapPath(@"\App_Data\PagingData.mdf") + ";Integrated Security=SSPI;User Instance=true";
            string lang = Request.QueryString["lang"];

            if (lang == null || lang.Equals("vi"))
            {
                dt = data.getContent();
                foreach (DataRow dr in dt.Rows)
                {
                    Session[dr["cont_varible"].ToString()] = dr["cont_vi"];
                }
            }
            else
            {
                dt = data.getContent();
                foreach (DataRow dr in dt.Rows)
                {
                    Session[dr["cont_varible"].ToString()] = dr["cont_en"];
                }
            }
        }
    }
}